package com.cy.pj.category.dao;

import com.cy.pj.category.pojo.Category;
import com.cy.pj.common.anno.RequiredCache;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.relational.core.sql.In;

import java.util.List;

@Mapper
public interface CategoryDao {

//    @Select("select * from tb_category")
    @RequiredCache
    List<Category> findCategory(String name);

    @Select("select * from tb_category where id = #{id}")
    Category findCategoryById(String id);
    Integer updateCategory(Category category);

    Integer insertCategory(Category category);

    @Delete("delete from tb_category where id = #{id}")
    Integer deleteCategoryById(String id);


}
